package model;
/**
 * 分页的工具类
 */

import java.util.List;

public class Page {
    private int pageNumber;//第几页（页面的位置）
    private int pageSize;//每页的大小，每页显示多少条
    private int totalCount;//总数量
    private int totalPage;//总页数

    private List<Object> list;//显示的对象集

    public void SetPageSizeAndTotalCount(int pageSize, int totalCount) {
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        //将小数部分舍去并且向前进一
        totalPage = (int) Math.ceil((double) totalCount / pageSize);
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List<Object> getList() {
        return list;
    }

    public void setList(List<Object> list) {
        this.list = list;
    }
}
